package PenTest.haikang;

import java.util.*;

class Solution {

    /* Write Code Here */
    public int[] singleNumber(int[] nums) {
        Map<Integer, Integer> map = new HashMap<>();
        for (int num : nums) {
            map.put(num, map.getOrDefault(num, 0) + 1);
        }
        List<Integer> list = new ArrayList<>();
        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            if (entry.getValue() == 1) {
                list.add(entry.getKey());
            }
        }

        return list.stream().mapToInt(i -> i).toArray();
    }
}

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int nums_size = in.nextInt();
        int[] nums = new int[nums_size];
        for (int nums_i = 0; nums_i < nums_size; nums_i++) {
            nums[nums_i] = in.nextInt();
        }

        if (in.hasNextLine()) {
            in.nextLine();
        }
        int[] res = new Solution().singleNumber(nums);
        if (res == null || res.length == 0) {
            System.out.println(-1);
        } else {
            Arrays.sort(nums);
            for (int res_i = 0; res_i < res.length; res_i++) {
                System.out.println(res[res_i]);
            }
        }
    }
}
